﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZFSData;

namespace ZFSInterface.User
{
    
    /// <summary>
    /// 用户数据操作接口
    /// </summary>
    public interface IUser
    {
        /// <summary>
        /// 获取用户数据
        /// </summary>
        /// <returns>用户信息集合</returns>
        List<tb_User> GetUsers(string search);

        /// <summary>
        /// 根据账户获取账户信息
        /// </summary>
        /// <param name="account">账号</param>
        /// <returns>结果</returns>
        tb_User GetUser(string account);

        /// <summary>
        /// 新增账户
        /// </summary>
        /// <param name="user">用户信息</param>
        /// <returns>结果</returns>
        bool Add(tb_User user);

        /// <summary>
        /// 更新账户信息
        /// </summary>
        /// <param name="user">用户</param>
        /// <returns>结果</returns>
        bool Update(tb_User user);

        /// <summary>
        /// 删除账户
        /// </summary>
        /// <param name="account">账号</param>
        /// <returns>结果</returns>
        bool Delete(string account);

        /// <summary>
        /// 是否存在
        /// </summary>
        /// <param name="account">账号</param>
        /// <returns>结果</returns>
        bool Exits(string account);

        /// <summary>
        /// 登出
        /// </summary>
        /// <param name="account">账号</param>
        void Logout(string account);

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="account">账号</param>
        /// <param name="password">密码</param>
        /// <returns>用户信息</returns>
        tb_User Login(string account, string password);

        /// <summary>
        /// 获取用户权限
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        List<View_UserAuthority> GetAuthority(string account);
    }
}
